<script type="text/javascript" src="/static/js/DatePicker/WdatePicker.js"></script>
<style>
.button {
   border-top: 1px solid #96d1f8;
   background: #65a9d7;
   background: -webkit-gradient(linear, left top, left bottom, from(#3e779d), to(#65a9d7));
   background: -webkit-linear-gradient(top, #3e779d, #65a9d7);
   background: -moz-linear-gradient(top, #3e779d, #65a9d7);
   background: -ms-linear-gradient(top, #3e779d, #65a9d7);
   background: -o-linear-gradient(top, #3e779d, #65a9d7);
   padding: 5px 10px;
   -webkit-border-radius: 8px;
   -moz-border-radius: 8px;
   border-radius: 8px;
   -webkit-box-shadow: rgba(0,0,0,1) 0 1px 0;
   -moz-box-shadow: rgba(0,0,0,1) 0 1px 0;
   box-shadow: rgba(0,0,0,1) 0 1px 0;
   text-shadow: rgba(0,0,0,.4) 0 1px 0;
   color: white;
   font-size: 14px;
   font-family: Georgia, serif;
   text-decoration: none;
   vertical-align: middle;
   }
.button:hover {
   border-top-color: #28597a;
   background: #28597a;
   color: #ccc;
   }
.button:active {
   border-top-color: #1b435e;
   background: #1b435e;
   }
</style>

<script>
	$(function(){
		$('#statistics_tb').datagrid({
			columns:[[
			  		{field:'selected', checkbox:true },
			  	    {field:'accountname',title:'账号',width:100, sortable:true,
			  			sorter:function(a,b){
			  				return (a>b?1:-1);
			  			}
			  		},
			  		{field:'balance',title:'余额',width:50},
			  		{field:'accounttype',title:'账号类型',width:50},
			  		{field:'totalamount',title:'销售总额',width:50},
			  		{field:'xs_bank',title:'刷卡销售额',width:60},
			  		{field:'xs_toubi',title:'投币销售额',width:60},
			  		{field:'chongzhi',title:'充值金额',width:60},
			  		{field:'cz_bank',title:'刷卡充值',width:60},
			  		{field:'cz_rg',title:'人工充值',width:60},
			  		{field:'ticheng',title:'提成金额',width:60},
			  		{field:'prize',title:'返奖金额',width:60},
			  		{field:'tixian',title:'提现金额',width:60}
			  	]],
			    onLoadError: function() {
			    	$.jBox.tip('没有数据或根据搜索条件查不到相关数据', 'info');
			    	$("div.datagrid-body").css("height",0).find("table > tbody").empty();
		    		$("div.datagrid-view").css("height",'23px');
		   	 	}
		});
	});
	
	function do_statistic(){
		var starttime = $("#sstart_time").val();
    	var endtime = $("#send_time").val();
    	var result = $('#statistics_tb').datagrid('reload', {
            start:starttime,
            end:endtime
        });
     }
	function do_export(){
		var starttime = $("#sstart_time").val();
    	var endtime = $("#send_time").val();
    	if(!starttime||!endtime){
    		$.jBox.tip('请输入开始时间和结束时间', 'info');
    		return;
    	}
    	window.location.href="/lottery/report/statistics/"+starttime+"/"+endtime;
	}
	
</script>


<div style="padding:20px;overflow:hidden;" class="ajust_height">
	<div style="float:left;margin-right:10px;">
		<label>开始时间：</label>
		<input type="text" id="sstart_time" size="22" value="" style="border:1px #55B7FF solid">
		<img onclick="WdatePicker({el:'sstart_time',dateFmt:'yyyy-MM-dd'})" src="/static/js/DatePicker/skin/datePicker.gif" width="16" height="22" align="absmiddle">
	</div>
	<div style="float:left;margin-right:10px;"">
		<label>结束时间：</label>
		<input type="text" id="send_time" size="22" value="" style="border:1px #55B7FF solid">
		<img onclick="WdatePicker({el:'send_time',dateFmt:'yyyy-MM-dd'})" src="/static/js/DatePicker/skin/datePicker.gif" width="16" height="22" align="absmiddle">
	</div>
	<div style="float:left;"><a class="button" href="#" onclick="do_statistic();">点击统计</a></div>
	<div style="float:left;margin-left:20px;"><a class="button" href="#" onclick="do_export();">导出报表</a></div>
	<div style="clear:both;padding-bottom:20px;"></div>
	<table id="statistics_tb" url="/lottery/count_inquire/statistics/data" striped="true"
		pagination="true" iconCls="icon-save" url="" fitColumns="true" singleSelect="false"
		rownumbers="true" pageSize="15"   pageList=" [15,20,25,30,40]">
	</table>
</div>

